import request from '@/utils/request'

// 查询股票交易任务列表
export function listTrade(query) {
    return request({
        url: '/stock/trade/list',
        method: 'get',
        params: query
    })
}

// 查询股票交易任务详细
export function getTrade(id) {
    return request({
        url: '/stock/trade/' + id,
        method: 'get'
    })
}

// 新增股票交易任务
export function addTrade(data) {
    return request({
        url: '/stock/trade',
        method: 'post',
        data: data
    })
}

// 修改股票交易任务
export function updateTrade(data) {
    return request({
        url: '/stock/trade',
        method: 'put',
        data: data
    })
}

// 更新交易任务状态
export function updateTradeStatus(data) {
    return request({
        url: '/stock/trade/status',
        method: 'put',
        data: data
    })
}

export function startTradeMonitor() {
    return request({
        url: '/stock/trade/monitor/start',
        method: 'post',
    })
}

export function stopTradeMonitor() {
    return request({
        url: '/stock/trade/monitor/stop',
        method: 'post',
    })
}

export function getTradeMonitorStatus() {
    return request({
        url: '/stock/trade/monitor/status',
        method: 'get'
    })
}